import java.awt.Color;

import info.gridworld.actor.Flower;


public class DyingFlower extends Flower{

	private static final Color DEFAULT_COLOR = Color.PINK;
	private static final double DARKENING_FACTOR = 0.05;

	public DyingFlower(){
		super();
	}

	@Override
	public void act()
	{
		Color c = getColor();
		int red = (int) (c.getRed() * (1 - DARKENING_FACTOR));
		int green = (int) (c.getGreen() * (1 - DARKENING_FACTOR));
		int blue = (int) (c.getBlue() * (1 - DARKENING_FACTOR));

		if(red == 0 && green == 0 && blue == 0){
			this.removeSelfFromGrid();
		}
		else{
			setColor(new Color(red, green, blue));
		}
	}
}
